package com.kunya.product.dao.specification;

import com.kunya.product.po.ProductSpecification;
import com.kunya.product.vo.SpecificationKindVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductSpecificationMapper {
    int deleteByPrimaryKey(@Param("productSpecId") Long productSpecId,@Param("table_prefix") String table_prefix);

    int insert(@Param("record") ProductSpecification record,@Param("table_prefix") String table_prefix);

    int insertSelective(@Param("record") ProductSpecification record,@Param("table_prefix") String table_prefix);

    ProductSpecification selectByPrimaryKey(@Param("productSpecId") Long productSpecId,@Param("table_prefix") String table_prefix);

    int updateByPrimaryKeySelective(@Param("record") ProductSpecification record,@Param("table_prefix") String table_prefix);

    int updateByPrimaryKey(@Param("record") ProductSpecification record,@Param("table_prefix") String table_prefix);

    ProductSpecification selectByProductSpecNumber(@Param("productSpecNumber") Long productSpecNumber,@Param("table_prefix") String table_prefix);

    /**
     * @author zp
     * @Description: 根据商品id和商品规格属性status查询商品规格属性list
     * @param
     * @date 2018/7/4 14:11
     */
    List<ProductSpecification> selectByProductId(@Param("productId") Long productId,@Param("status") Byte status,@Param("table_prefix") String table_prefix);

    /**
     * 通过商品id去删除表中的所有数据
     * @author suimg
     * @date 2018/7/11 15:13
     */
    int deleteProductSpecificationByProductId(@Param("productId") Long productId,@Param("table_prefix") String table_prefix);

    List<SpecificationKindVo> getSpecificationAndKindByProductId(@Param("productId") Long productId,@Param("specAttrIds") List<Long> specAttrIds,@Param("table_prefix") String table_prefix);
}